﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.ObjectModel;
using System.Windows.Data;
using System.Windows.Media;

namespace ChoJu.Converters.Uc
{
    public class RunBtnBlkConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var lst = value as ObservableCollection<string>;
            var pa = parameter?.ToString();
            if (lst?.Contains(pa) == false)
            {
                Color color = (Color)ColorConverter.ConvertFromString("#3788FB");
                return new SolidColorBrush(color);
            }
            else
            {
                Color color = (Color)ColorConverter.ConvertFromString("#0DD606");
                return new SolidColorBrush(color);
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
